var isON = false;
chrome.browserAction.onClicked.addListener(function(tab) {
	isON = !isON;
	var script;
	var icon;
	if(isON){
		script = 'content_script.js';
		icon = 'Dictionary-Book-icon.png';
	}else{
		script = 'content_script_disable.js';
		icon = 'Dictionary-Book-icon-gray.png';
	}
	chrome.tabs.query({}, function(tabs){
		chrome.browserAction.setIcon({path:icon});
		for (var i = 0; i < tabs.length; i++) {
            chrome.tabs.executeScript(tabs[i].id, {file: script});
        }
	});
});